package com.twu.biblioteca.app;

import com.twu.biblioteca.core.*;
import com.twu.biblioteca.io.MainMenu;
import com.twu.biblioteca.io.UserIOParser;
import com.twu.biblioteca.session.UserSession;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class BibliotecaApp {

    public static void main(String[] args) {

        List<Book> books = new ArrayList<Book>();

        books.add(new Book("Patito lee"));
        books.add(new Book("El libro fantastico"));
        books.add(new Book("Ricitos de oro"));

        List<Movie> movies = new ArrayList<Movie>();

        movies.add(new Movie("Pulp fiction", 1994, "Quentin Tarantino", 10));

        Library library = new Library(books, movies);

        List<User> users = new ArrayList<User>();

        UserInformation userInformation = new UserInformation("Cris", "cris@mail", "3330738");
        User user = new User("123-1234", "pass", userInformation);

        users.add(user);

        UserSession userSession = new UserSession(users);

        BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));
        UserIOParser userIOParser = new UserIOParser(bufferedReader);

        MainMenu mainMenu = new MainMenu(userIOParser, library, userSession);

        mainMenu.greet();
        mainMenu.showMenu();

    }
}
